using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using MyMvc.Model.Models.Mapping;

namespace MyMvc.Model.Models
{
    public partial class GreenProtectContext : DbContext
    {
        static GreenProtectContext()
        {
            Database.SetInitializer<GreenProtectContext>(null);
        }

        public GreenProtectContext(): base("Name=GreenProtectContext")
        {
        }

        public DbSet<AboutArticle> AboutArticles { get; set; }
        public DbSet<AddFile> AddFiles { get; set; }
        public DbSet<Article> Articles { get; set; }
        public DbSet<CategoryType> CategoryTypes { get; set; }
        public DbSet<File> Files { get; set; }
        public DbSet<Note> Notes { get; set; }
        public DbSet<Relation> Relations { get; set; }
        public DbSet<User> Users { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new AboutArticleMap());
            modelBuilder.Configurations.Add(new AddFileMap());
            modelBuilder.Configurations.Add(new ArticleMap());
            modelBuilder.Configurations.Add(new CategoryTypeMap());
            modelBuilder.Configurations.Add(new FileMap());
            modelBuilder.Configurations.Add(new NoteMap());
            modelBuilder.Configurations.Add(new RelationMap());
            modelBuilder.Configurations.Add(new UserMap());
        }
    }
}
